{extend name="./oscshop/admin/view/public/base.html" /}
{block name="content"}
<div class="page-header">
	<h1>	
		{$breadcrumb1}
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			{$breadcrumb4}
		</small>
	</h1>
</div>

<form action="{:url('Change/gold_record')}" method="get">
	<table class="table table-striped table-bordered table-hover search-form">
		<thead>
		<tr>
			<th>
				<input name="username" type="number" placeholder="输入用户名" value="{:input('param.username')}" />
				<input name="first_time" type="date" placeholder="输入时间" value="{:input('param.first_time')}" />
				<button class="btn btn-primary">查询</button>&nbsp;&nbsp;&nbsp;
				<a href="{:url('Change/gold_record')}" class="btn btn-primary">清空查询条件</a>
			</th>
		</tr>
		</thead>
	</table>
</form>
<div class="row">
	<div class="col-xs-12">
		<div class="table-responsive">
			<table id="con_table" class="table table-striped table-bordered table-hover">
				<thead>
					<tr>
						<th>用户</th>
						<th>姓名</th>
						<th>交易所</th>
						<th>交易品种</th>
						<th>换购枚数</th>
						<th>换购金额</th>
						<th>发行价</th>
						<th>描述</th>
						<th>提交时间</th>
					</tr>
				</thead>
				<tbody>
					{volist name="list" id="v"}
					<tr>
						<td>{$v.username}</td>
						<td>{:get_member_idcardname($v.username)}</td>
						<td>{:get_trade_name($v.exchange_id)}</td>
						<td>{:get_variety_name($v.variety_id)}</td>
						<td>{$v.num}</td>
						<td>{$v.money}</td>
						<td>{$v.issue}</td>
						<td>{$v.description}</td>
						<td>
							{:date('Y-m-d H:i:s',$v['create_time'])}
						</td>
					</tr>
					{/volist}
				</tbody>

			</table>
		</div>
		{$page}
	</div>
</div>
{/block}
{block name="javascript"}
<script>
	function topLeft(id){
		var judge = prompt("审批意见");
		window.location.href = "repulse?id="+id+"&desc="+judge;
	}

	$(function(){
	   	$(".search").click(function () {
			var url = $(this).attr('url');
			var query = $('.search-form').find('input,select').serialize();
			query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
			query = query.replace(/^&/g, '');
			if (url.indexOf('?') > 0) {
				url += '&' + query;
			} else {
				url += '?' + query;
			}
//		   	alert(url);
			window.location.href = url;
		});
	});

	$(function(){
		$(".batch").click(function () {
			//alert('test');
			var r = confirm("确认是否批量审核");
			if(r==false)
			{
				return;
			}
			document.getElementById("myForm").submit()

		});
	});
	$("#all1").change(function() {

		var chk = this.checked;

		var ck_list = $("#con_table").find("input[type='checkbox']");

		var len = ck_list.length;
		//alert(len);
		for (var i = 0; i < len; i++) {
			if (chk == false) {
				ck_list[i].checked = false;

			}
			else {
				ck_list[i].checked = true;
			}
		}
	});
</script>
{/block}